/*! ============================================================================
 * @file scope_timer.cpp 
 * @Synopsis  
 * @author DongKai
 * @version 1.0
 * @date 2009年12月04日
 *  Company: Beijing Feynman Software Technology Co., Ltd.
 */

#include <scope_timer.hpp>
#include <iostream>

namespace utilx {

ScopeTimer::ScopeTimer(const char * name) :
    scope_name_(name)
{
    if (NULL == scope_name_)
    {
        scope_name_ = "";
    }

    start_timing();
}		/* -----  end of method ScopeTimer::ScopeTimer  ----- */

ScopeTimer::~ScopeTimer()
{
    stop_timing();
    std::cout << "Scope " << scope_name_ << " waste time: " <<
        get_interval() << std::endl;
}		/* -----  end of method ScopeTimer::ScopeTimer  ----- */

}
